package com.jzr.medical.controller.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jzr.common.entity.vo.Result;
import com.jzr.medical.db1.service.MenuService;
import com.jzr.medical.db1.vo.MenuVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/list")
    public Result<List<MenuVo>> list(){
        QueryWrapper<MenuVo> qw = null;
        List<MenuVo> list = menuService.list(qw);
        return Result.success("成功",list);
    }

    @PostMapping("/saveBatch")
    public Result<List<MenuVo>> saveBatch(@RequestBody List<MenuVo> list){
        List<MenuVo> result = menuService.saveBatch(list);
        return Result.success("成功",result);
    }
}
